<script setup>
// import { useRouter, useRoute } from 'vue-router'
// import { useUserStore } from '@/stores/modules/user'

// const router = useRouter()
// const route = useRoute() // 获取 Current route information
// const userStore = useUserStore()

// function goList() {
//   router.push('/about')
//   console.log(router, route)
// }
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import en from 'element-plus/dist/locale/en.mjs'
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'

const { locale } = useI18n({ useScope: 'global' })

// 根据当前语言动态计算 ElementPlus 语言包
const currentLocale = computed(() => {
  switch (locale.value) {
    case 'en':
      return en

    default:
      return zhCn
  }
})
</script>

<template>
  <div>
    <el-config-provider :locale="currentLocale"
      ><router-view></router-view
    ></el-config-provider>
  </div>
</template>

<style scoped></style>
